package com.oocl.service.impl;

import java.util.List;

import com.oocl.dao.CustomerDao;
import com.oocl.dao.impl.CustomerDaoFactory;
import com.oocl.pojo.Customer;
import com.oocl.service.CustomerManager;

public class CustomerManagerImpl implements CustomerManager{
	private CustomerDao customerDao;
	
	public CustomerManagerImpl() {
		customerDao = CustomerDaoFactory.getInstance();
	}

	@Override
	public int addCustomer(Customer customer) {
		return customerDao.addCustomer(customer);
	}

	@Override
	public int deleteCustomerById(Integer id) {
		return customerDao.deleteCustomerById(id);
	}

	@Override
	public int updateCustomer(Customer customer) {
		return customerDao.updateCustomer(customer);
	}

	@Override
	public List<Customer> findAllCustomers() {
		return customerDao.findAllCustomers();
	}

	@Override
	public List<String> findHobbyByCid(Integer cid) {
		return customerDao.findHobbyByCid(cid);
	}

	@Override
	public Customer findCustomerById(Integer id) {
		return customerDao.findCustomerById(id);
	}

	@Override
	public int findCustomerIdByName(String cname) {
		return customerDao.findCustomerIdByName(cname);
	}

}
